<?php

class Default_Controllers_Contact extends Libs_Controller {

    function __construct() {
        parent::__construct();
    }

    public function index() {
        if (isset($_POST['btnSubmit'])) {
            $name = $_POST['txtName'];
            $email = $_POST['txtEmail'];
            $mobi = $_POST['txtMobi'];
            $company = $_POST['txtCompany'];
            $title = $_POST['txtTitle'];
            $content = $_POST['txtContent'];
            $post_date = date('Y-m-d h:i:s', time());
            $data = array(
                "full_name" => "$name",
                "email" => "$email",
                "content" => "$content",
                "title" => "$title",
                "company" => "$company",
                "mobi" => "$mobi",
                "post_date" => "$post_date"
            );
            $contact = new Default_Models_Contact();
            $contact->Contact_Process($data);
        }
        $this->view->render('contact/index');
    }

}
